import request from './request';

export const couponService = {
  // 获取优惠券列表
  getCouponList(params) {
    return request({
      url: 'Coupon/list',
      method: 'GET',
      data: params
    });
  },
  
  // 领取优惠券
  receiveCoupon(couponId) {
    return request({
      url: `Coupon/${couponId}/receive`,
      method: 'POST'
    });
  },
  
  // 获取可用优惠券列表
  getAvailableCoupons(amount) {
    return request({
      url: 'Coupon/available',
      method: 'GET',
      data: { amount }
    });
  },
  
  // 使用优惠券
  useCoupon(couponId) {
    return request({
      url: `Coupon/${couponId}/use`,
      method: 'POST'
    });
  }
}; 